import { 
    StatusBar,
    StyleSheet, 
    Text, 
    View ,
    Image,
    ImageBackground,
    TextInput,
    Button,
    TouchableOpacity
  } from 'react-native';
  import {useState} from 'react';
  
  export default function App() {
    const [value,setValue] = useState('') 
    return (
      <View>
        <Text>能继承父级text组件的字体样式</Text>
        {/* <Image 
          style={{width:100,height:100,position:'absolute'}}
          source={require('./assets/favicon.png')}/>
        <Image 
          style={{width:400,height:80}}
          source={{uri:'http://www.edu2act.cn/static/images/logo.png'}}/> */}
        {/* <ImageBackground
          style={{width:200,height:200}}
          source={require('./assets/adaptive-icon.png')}>
            <Text>背景图</Text>
        </ImageBackground> */}
        <TextInput 
          value={value}
          onChangeText={text=>setValue(text)}
          style={{
            borderWidth:3,
            borderColor:'#adf',
            width:300,
            height:50,
            borderRadius:10,
            alignSelf:'center',
            margin:20,
            paddingHorizontal:20,//设置水平方向的光标边距
          }}
        />
        <Text>{value}</Text>
        <Button
          title='按钮'
          color='#f00' 
        />
        <TouchableOpacity
          style={{
            backgroundColor:'#aec',
            height:40,
            width:300,
            justifyContent:'center',
            alignItems:'center',
            alignSelf:'center',
            marginTop:30,
            borderRadius:20
  
          }}
        >
          <Text>TouchableOpacity按钮</Text>
        </TouchableOpacity>
        <StatusBar/>
      </View>
    );
  }
  
  // native中布局元素默认就是弹性盒
  
  const styles = StyleSheet.create({
    container: {
      backgroundColor: '#eee',
      height:200,//宽高没有单位
      alignItems:'center',
      justifyContent:'center'
    },
    textColor:{
      color:'#f00',
      fontSize:30
    }
  });
  